package com.lzj.service.impl;

import com.lzj.dao.BaseDao;
import com.lzj.dao.UserDao;
import com.lzj.entity.*;
import com.lzj.service.UserService;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @autor:lzj
 * @date:2021/12/2
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao;

    public void setUserDao(UserDao userDao){
        this.userDao=userDao;
    }

    @Override
    public User queryUser(String name, String pwd) {
        return userDao.queryUser(name,pwd);
    }

    @Override
    public User queryUserUsername(String name) {
        return userDao.queryUserUsername(name);
    }

    @Override
    public UserInfomation queryUserInf(int userId) {
        return userDao.queryUserInf(userId);
    }

    @Override
    public Address queryAddress(int userId) {
        return userDao.queryAddress(userId);
    }

    @Override
    public Sku querySku(int id) {
        return userDao.querySku(id);
    }

    @Override
    public List<ShoppCart> queryShoppCart(int userId) {
        return userDao.queryShoppCart(userId);
    }

    @Override
    public List<Order> queryOrder(int userId) {
        return userDao.queryOrder(userId);
    }

    @Override
    public List<OrderData> queryOrderData(int userId) {
        return userDao.queryOrderData(userId);
    }

    @Override
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public int addUserInf(UserInfomation userInfomation) {
        return userDao.addUserInf(userInfomation);
    }

    @Override
    public int updateUserInf(UserInfomation userInfomation) {
        return userDao.updateUserInf(userInfomation);
    }

    @Override
    public int addAddress(Address address) {
        return userDao.addAddress(address);
    }

    @Override
    public int updateAddress(Address address) {
        return userDao.updateAddress(address);
    }

    @Override
    public int addShoppCart(ShoppCart shoppCart) {
        return userDao.addShoppCart(shoppCart);
    }

    @Override
    public int deleteShoppCart(int skuId,int userId) {
        return userDao.deleteShoppCart(skuId,userId);
    }

    @Override
    public int updateShoppCart(int count,double totalPrice,int skuId,int userId) {
        return userDao.updateShoppCart(count,totalPrice,skuId,userId);
    }

    @Override
    public int addOrder(Order order) {
        return userDao.addOrder(order);
    }

    @Override
    public int addOrderData(OrderData orderData) {
        return userDao.addOrderData(orderData);
    }
}
